﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class BackpackItem 
{
    public enum ItemType
    {
        UnKown =-1, // 全部道具
        Equip, //装备
        Chips, // 碎片
    }
    /// <summary>
    /// 道具的唯一ID 区别于其它的道具
    /// </summary>
    public int ItemID;

    public ItemType MItemType = ItemType.UnKown;

    // item name
    public string ItemName;
    /// <summary>
    /// 道具的描述信息
    /// </summary>
    public string ItemDesc;

    public string ItemIcon;
    public string ItemBgIcon;
    public int ItemCount;
    public int ItemQua;
    /// <summary>
    /// 道具的操作，如 分解 合成 出售  装备 等等
    /// </summary>
    public int ItemOpreation;

    /// <summary>
    /// 构造一个Item
    /// </summary>
    /// <param name="itemid"></param>
    /// <param name="name"></param>
    /// <param name="desc"></param>
    /// <param name="itemType"> -1 :all 0 ：equip 1:chips </param>
    /// <param name="icon"></param>
    /// <param name="bgIcon"></param>
    /// <param name="itemcount"></param>
    /// <param name="quality">0:white 1:cyan 2:green 3:red  </param>
    /// <param name="opreation"></param>
    public BackpackItem(int itemid,string name,string desc,int itemType,string icon,
        string bgIcon,int itemcount,int quality,int opreation)
    {
        this.ItemID = itemid;
        this.ItemName = name;
        this.ItemDesc = desc;
        switch (itemType)
        {
            case -1:
                this.MItemType = ItemType.UnKown;
                break;
            case 0:
                this.MItemType = ItemType.Equip;
                break;
            case 1:
                this.MItemType = ItemType.Chips;
                break;
            default:
                break;
        }
        this.ItemIcon = icon;
        this.ItemBgIcon = bgIcon;
        this.ItemCount = itemcount;
        this.ItemQua = quality;
        this.ItemOpreation = opreation;

    }
}

